﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<PagingResult<LiteratureManage.Domain.Models.Literature>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="width:1000px;">
        <div><% Html.RenderPartial(MVC.Literature.Views.ListSearchBox, new LiteratureSearchViewModel()); %></div>
        <div style="padding:5px; text-align:right;">
            [<%=Html.ActionLink("创建文献", MVC.Literature.Create()) %>]
        </div>
        <div>
            <table id="list" class="table">
                <thead>
                    <tr>
                        <th style="width:50px;">编号</th>
                        <th style="width:200px;">文章名称</th>
                        <th style="width:100px;">学科类别</th>
                        <th style="width:100px;">文章来源</th>
                        <th style="width:100px;">发表日期</th>
                        <th style="width:50px;">操作</th>
                     </tr>
                </thead>
            <%if (Model.TotalItems > 0)
              { %>
                    <%foreach (var item in Model.Items)
                      {
                        %>
                        <tr class="table_row">
                            <td><%=item.Id %></td>
                            <td style=" text-align:left;"><a class="listAuthors" href="javascript:void(0)"><%=item.ArticleName %></a></td>
                            <td><%=item.SubjectCatalog %></td>
                            <td><%=item.ArticleSource %></td>
                            <td><%=item.ArticlePublishDate.ToShortDateString() %></td>
                            <td><%=Html.ActionLink("修改", MVC.Literature.Edit(item.Id)) %></td>
                        </tr>
                     <%
                      } %>
            <%}
              else
              { %>
              <tr style="height:300px;">
                <td colspan="6">暂无任何结果</td>
              </tr>
            <%} %>
            </table>
            <div class="pages" style="padding:0; float:right;">
                <%=Html.Pager("page", Model.PageSize, Model.TotalItems) %>
            </div>  
            
        </div>
    </div>
    <script type="text/javascript">
        $(function() {
            var rows = $("#list .table_row");
            var url = "<%=Url.Action(MVC.Literature.AjaxListAuthors()) %>";
            $(".listAuthors").each(function() {
                $(this).qtip({
                    "content": {
                        "text": "<img src='/Content/Images/ajax-loader.gif' alt=''/>",
                        "url": url,
                        "data": { "literatureId": $(this).parent().prev().html() },
                        "method": "get"
                    },
                    "style": { "width": { "min": "1000px"} },
                    "position": { "corner": { "target": "bottomLeft", "tooltip": "topLeft"} }
                });
            });
        });
    </script>
</asp:Content>
